# 设置目标系统为Linux ARM架构
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)   # 根据RK3506芯片架构调整（如armv7或aarch64）


# 指定交叉编译器路径（替换为实际路径）
set(TOOLCHAIN_PATH /opt/work/ok3506j/toolchains/arm-buildroot-linux-gnueabihf_sdk-buildroot)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PATH}/bin/arm-linux-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PATH}/bin/arm-linux-g++)


# 搜索规则设置
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)


#执行以下命令可以重新生成
#cmake .. -DCMAKE_TOOLCHAIN_FILE=../rk3506-toolchain.cmake